<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>jQuery Mobile Docs - Button options</title>
	<link rel="stylesheet"  href="../../css/themes/default/jquery.mobile-1.2.0.css" />
	<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>

	<script src="../../js/jquery.js"></script>
	<script src="../../docs/_assets/js/jqm-docs.js"></script>
	<script src="../../js/jquery.mobile-1.2.0.js"></script>

</head>
<body>

	<div data-role="page" class="type-interior">

		<div data-role="header" data-theme="f">
		<h1>Button basics</h1>
		<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
		<a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
	</div><!-- /header -->

	<div data-role="content">
		<div class="content-primary">

		<form action="#" method="get">

			<h2>Button basics</h2>		
		
         <ul data-role="controlgroup" data-type="horizontal" class="localnav">
   			<li><a href="buttons-types.html" data-role="button" data-transition="fade">Basics</a></li>
   			<li><a href="buttons-options.html" data-role="button" data-transition="fade" class="ui-btn-active">Options</a></li>
   			<li><a href="buttons-methods.html" data-role="button" data-transition="fade">Methods</a></li>
   			<li><a href="buttons-events.html" data-role="button" data-transition="fade">Events</a></li>
   		</ul>	
			
			<p>The following options apply to <strong>all buttons</strong>:</p>

		<dl>			
			<dt><code>corners</code> <em>boolean</em></dt>
			<dd>
				<p class="default">default: true</p>
				<p>Applies the theme button border-radius if set to true. This option is also exposed as a data attribute: <code>data-corners=&quot;false&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ corners: false }</strong>);</code></pre>
				<a href="#" data-role="button" data-corners="false">No rounded corners</a>
			</dd>			
			<dt><code>icon</code> <em>string</em></dt>
			<dd>
				<p class="default">default: null</p>
				<p>Applies an icon from the <a href="../buttons/buttons-icons.html">icon set</a>. This option is also exposed as a data attribute: <code>data-icon=&quot;star&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ icon: "star" }</strong>);</code></pre>
				<a href="#" data-role="button" data-icon="star">Star icon</a>
			</dd>
			
			<dt><code>iconpos</code> <em>string</em></dt>
			<dd>
				<p class="default">default: "left"</p>
				<p>Positions the icon in the button. Possible values: left, right, top, bottom, none, notext. The notext value will display an icon-only button with no text feedback. This option is also exposed as a data attribute: <code>data-iconpos=&quot;left&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ iconpos: "right" }</strong>);</code></pre>
				<a href="#" data-role="button" data-icon="star" data-iconpos="right">Star icon</a>
			</dd>
			
			<dt><code>iconshadow</code> <em>boolean</em></dt>
			<dd>
				<p class="default">default: true</p>
				<p>Applies the theme shadow to the button's icon if set to true. This option is also exposed as a data attribute: <code>data-iconshadow=&quot;false&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ iconshadow: false }</strong>);</code></pre>
				<a href="#" data-role="button"  data-icon="star" data-iconshadow="false">No icon shadow</a>
			</dd>
			
			<dt><code>inline</code> <em>boolean</em></dt>
			<dd>
				<p class="default">default: null (false)</p>
				<p>If set to true, this will make the button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: <code>data-inline=&quot;true&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ inline: true }</strong>);</code></pre>
				<a href="#" data-role="button" data-inline="true">Inline</a>
			</dd>
			
			<dt><code>mini</code> <em>boolean</em></dt>
			<dd>
				<p class="default">default: null (false)</p>
				<p>If set to true, this will display a more compact version of the button that uses less vertical height. Possible values: true, false. This option is also exposed as a data attribute: <code>data-mini=&quot;true&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ mini: true }</strong>);</code></pre>
				<a href="#" data-role="button" data-mini="true">Mini</a>
			</dd>
			
			<dt><code>shadow</code> <em>boolean</em></dt>
			<dd>
				<p class="default">default: true</p>
				<p>Applies the drop shadow style to the button if set to true. This option is also exposed as a data attribute: <code>data-shadow=&quot;false&quot;</code></p>
				<pre><code>$('a').buttonMarkup(<strong>{ shadow: false }</strong>);</code></pre>
				<a href="#" data-role="button" data-shadow="false">No button shadow</a>
			</dd>
			
			<dt><code>theme</code> <em>string</em></dt>
			<dd>
				<p class="default">default: null, inherited from parent</p>
				<p>Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to one of the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set. This option is also exposed as a data attribute: <code>data-theme=&quot;a&quot;</code></p>			
				<pre><code>$('a').buttonMarkup(<strong>{ theme: "a" }</strong>);</code></pre>
				<a href="#" data-role="button" data-theme="a">Theme A</a>
			</dd>					
		</dl>	
		
		<div class="ui-body ui-body-e">
		<p>The following option applies only to <strong>form buttons</strong>, which are automatically initialized by the framework:</p>
		</div>
				
		<dl>
			<dt><code>initSelector</code> <em>CSS selector string</em></dt>
			<dd>
				<p class="default">default: "button, [type='button'], [type='submit'], [type='reset']"</p>
				<p>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as form buttons. To change which elements are initialized, bind this option to the <a href="../api/globalconfig.html">mobileinit event</a>:</p>
<pre><code>$( document ).bind( "mobileinit", function(){
   <strong>$.mobile.button.prototype.options.initSelector = ".myButtons";</strong>
});
</code></pre>
			</dd>			
		</dl>	
		
    
	</form>
	</div><!--/content-primary -->		
	
	<div class="content-secondary">
		
		<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
			
				<h3>More in this section</h3>
				
				<ul data-role="listview" data-theme="c" data-dividertheme="d">				
					<li data-role="list-divider">Buttons</li>
					<li data-theme="a"><a href="buttons-types.html">Button basics</a></li>
					<li><a href="buttons-icons.html">Button icons</a></li>
					<li><a href="buttons-inline.html">Inline buttons</a></li>
					<li><a href="buttons-grouped.html">Grouped buttons</a></li>
					<li><a href="buttons-themes.html">Theming buttons</a></li>	
				</ul>
		</div>
	</div>		

</div><!-- /content -->

<div data-role="footer" class="footer-docs" data-theme="c">
		<p class="jqm-version"></p>
		<p>&copy; 2012 jQuery Foundation and other contributors</p>
</div>
	
</div><!-- /page -->

</body>
</html>

